from dotenv import load_dotenv
from selenium import webdriver
import pytest,requests
load_dotenv()

@pytest.fixture(scope='function')
def login():
    url = 'http://10.59.9.18/movieApi/user/v2/login'
    data = {'email':'1478997572@qq.com','pwd':'eWLPHopE945d2ivttHaQTQ=='}

    log = requests.post(url=url,data=data)
    print(log.json())
    sessionId = log.json()['result']['sessionId']
    userId = log.json()['result']['userId']
    yield sessionId,userId
    return sessionId,userId

@pytest.fixture(scope='function')
def driver():
    driver = webdriver.Edge()
    driver.maximize_window()
    yield driver
    driver.close()
